package com.bbs.action;

import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;

public class PugMsg extends ActionSupport{
	private String msgTitle;
	private String msgContent;
	private String verifyCode;
	public String getMsgTitle() {
		return msgTitle;
	}
	public void setMsgTitle(String msgTitle) {
		this.msgTitle = msgTitle;
	}
	public String getMsgContent() {
		return msgContent;
	}
	public void setMsgContent(String msgContent) {
		this.msgContent = msgContent;
	}
	public String getVerifyCode() {
		return verifyCode;
	}
	public void setVerifyCode(String verifyCode) {
		this.verifyCode = verifyCode;
	}
	
	public void checkPubMsg()throws Exception {
		
		String verifycode=(String)ServletActionContext.getRequest().getSession().getAttribute("verifyCode");
		String next=null;
		if(!verifyCode.equalsIgnoreCase(verifycode)&&verifyCode!=null){
		
			next="this";
		}else{
			next="success";
		}
		HttpServletResponse response=ServletActionContext.getResponse();
		response.setContentType("text/plain");
		PrintWriter out = response.getWriter();
		out.print(next);
		out.flush();
		out.close();
		
	}
	
	public String pubMsg(){
		return "success";
	}
}
